package com.pai4j.common.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class MomentConstants {




    @Getter
    @AllArgsConstructor
    public enum MomentStatusEnum {

        NEW(1, "新建动态"),
        REVIEW(2, "内容审核中..."),
        PUBLISHED(3, "已发布"),
        REJECT(4, "审核被拒绝");

        private int status;
        private String statusName;
    }


    @Getter
    @AllArgsConstructor
    public enum MediaType {

        IMAGE(1, "图片"),

        VIDEO(2, "视频");

        private int type;
        private String typeName;
    }

    public static MomentStatusEnum getStatusByReviewScore(Integer score) {
        if (score == null) {
            return null;
        }
        // 根据审核分数确定动态状态
        // 分数大于60分发布，小于等于40分拒绝，41-60分需要人工审核
        if (score > 60) {
            return MomentStatusEnum.PUBLISHED;
        } else if (score <= 40) {
            return MomentStatusEnum.REJECT;
        } else {
            // 41-60分的内容需要进一步审核
            return MomentStatusEnum.REVIEW;
        }
    }
}
